<%@page pageEncoding="UTF-8" isELIgnored="false"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@taglib prefix="f" uri="http://www.slim3.org/functions"%>

<%@ page import="java.util.ArrayList" %>
<%@ page import="slim3.demo.controller.six.FlightBean_Intl" %>

<html>
<head>
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<meta content="120; url=http://apbfour.appspot.com/six/intlTimeTable" http-equiv="refresh">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>松山機場 - 國際線今日客機航班時間表</title>
<link rel="stylesheet" type="text/css" href="blueprint/screen.css" />

<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="apple-touch-icon" href="apple-touch-icon.png"/>
<link rel="apple-touch-startup-image" href="apple-touch-icon.png" />

<script type="text/javascript" src="./jquery/jquery-1.6.2.min.js"></script>
<script type="text/javascript">
// When document is ready: this gets fired before body onload :)
$(document).ready(function(){
	// Write on keyup event of keyword input element
	$("#kwd_search").keyup(function(){
		// When value of the input is not blank
		if( $(this).val() != "")
		{
			// Show only matching TR, hide rest of them
			$("#my-table tbody>tr").hide();
			$("#my-table td:contains-ci('" + $(this).val() + "')").parent("tr").show();
		}
		else
		{
			// When there is no input or clean again, show everything back
			$("#my-table tbody>tr").show();
		}
	});
});
// jQuery expression for case-insensitive filter
$.extend($.expr[":"], 
{
    "contains-ci": function(elem, i, match, array) 
	{
		return (elem.textContent || elem.innerText || $(elem).text() || "").toLowerCase().indexOf((match[3] || "").toLowerCase()) >= 0;
	}
});

</script>

<style type="text/css">
<!--
@import url("table-images/style.css");
-->
</style>

<style type="text/css">

    @media print
    {
        #non-printable { display: none; }
    }
</style>

<style>

body{
	margin:0;
	padding:0;
	color:#000000;
	line-height:150%;
	text-align:left;
	font-family: "標楷體", Arial, Helvetica, sans-serif;
	font-size: 12px;
	background-color: #FFFFFF;
}
a{
	text-decoration:none;
	color:#000000;
}
a:hover{
	text-decoration:none;
	color:#999;
}
h1{
	font-size:140%;
	margin:0 20px;
	line-height:80px;	
}
h2{
	font-size:120%;
}
#container{
	margin:0 auto;
	width:680px;
	background:#fff;
	padding-bottom:20px;
}
#content{margin:0 20px;}
p.sig{	
	margin:0 auto;
	width:680px;
	padding:1em 0;
}
form{
	margin:1em 0;
	padding:.2em 20px;
	background:#FFF;
}
</style>


<script type="text/javascript">
<!--
function reload(condition) {
	if (condition == "yes") {
		document.location.reload(true);
	}
}
//-->
</script>


<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-33867276-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>


</head>
<body>
<div id="non-printable">
<center>
  <p class="notice"><font color="#CC6600" size="+1">此網頁每隔2分鐘將自動重新整理&nbsp;&nbsp;&nbsp;&nbsp;<a href="list"><font color="0000FF">主目錄</font></a></font></p><br>

<p><font color="#0000FF" size="+1" face="Verdana">即時搜尋：<input type="text" id="kwd_search" value=""/></font></p>

</center>
</div>


<table id="my-table" width="600" border="0" align="center" cellpadding="0" cellspacing="0">

			<%
				String year = (String) request.getAttribute("year");
				String month = (String) request.getAttribute("month");
				String day = (String) request.getAttribute("day");
				String hour = (String) request.getAttribute("hour");
				String minute = (String) request.getAttribute("minute");
				String second = (String) request.getAttribute("second");
			%>
			
  <thead><tr>
    <td colspan="2"><div align="center"><font size=6px>航空警察局台北分局<br />中華民國<%=year %>年<%=month %>月<%=day %>日<%=hour %>時<%=minute %>分<%=second %>秒<br />松山機場國際線今日客機航班時間表</font></div></td>
  </tr></thead>
  <tr>
  	<!--departure-->
    <td width="50%" valign="top">
		<table width="300" align="right" id="newspaper-a" summary="departure">
			<thead>
				<tr>
					<th width="45" align="center" valign="middle" scope="col">次序</th>
					<th width="117" align="center" valign="middle" scope="col">航空公司</th>
					<th width="91" align="center" valign="middle" scope="col">編號</th>
					<th width="95" align="center" valign="middle" scope="col">地點</th>
					<th width="88" align="center" valign="middle" scope="col"><b><font color="0033FF">出境</font></b></th>
				</tr>
			</thead>
			<tbody>
		  
			<%
				ArrayList<FlightBean_Intl> beans = (ArrayList<FlightBean_Intl>) request.getAttribute("departure");
				String temp = "";
				int counter = 0;
			%>
			<%
				if (beans.size()==0) {
			%>		
					</tbody></table><font color="#FF0000" size="+2">請稍等一下，為您重新讀取松山機場資料庫！</font>
					<script type="text/javascript" language="JavaScript">
	         			reload("yes");
	      			</script>
			<%
				} else {
			%>
			<%
				for (int i=0; i<beans.size(); i++) {
					counter++;
			%>
			  
				<tr>
					
					<td align="center" valign="middle"><%=counter %></td>
					
					<td align="center" valign="middle">
						<%
							if (beans.get(i).getAirline().equals("FM")) {
								temp = "上航";
							} else if (beans.get(i).getAirline().equals("NH")) {
								temp = "全日空";
							} else if (beans.get(i).getAirline().equals("CA")) {
								temp = "國航";
							} else if (beans.get(i).getAirline().equals("3U")) {
								temp = "川航";
							} else if (beans.get(i).getAirline().equals("MF")) {
								temp = "廈航";
							} else if (beans.get(i).getAirline().equals("GE")) {
								temp = "復興";
							} else if (beans.get(i).getAirline().equals("TW")) {
								temp = "德威";
							} else if (beans.get(i).getAirline().equals("JL")) {
								temp = "日航";
							} else if (beans.get(i).getAirline().equals("ESR")) {
								temp = "易斯達";
							} else if (beans.get(i).getAirline().equals("ZE")) {
								temp = "易斯達";
							} else if (beans.get(i).getAirline().equals("MU")) {
								temp = "東航";
							} else if (beans.get(i).getAirline().equals("AE")) {
								temp = "華信";
							} else if (beans.get(i).getAirline().equals("CI")) {
								temp = "華航";
							} else if (beans.get(i).getAirline().equals("FE")) {
								temp = "遠東";
							} else if (beans.get(i).getAirline().equals("BR")) {
								temp = "長榮";
							} else if (beans.get(i).getAirline().equals("B7")) {
								temp = "立榮";
							} else {
								temp = beans.get(i).getAirline();
							}
						%>
							<%=temp %>
					</td>
					
					<td align="center" valign="middle">
						<%
							temp = beans.get(i).getAirline() + "-" + beans.get(i).getFlightNo();
						%>
							<%=temp %>
					</td>
					
					<td align="center" valign="middle">
						<%
							if (beans.get(i).getDestination().equals("TSN")) {
								temp = "天津";
							} else if (beans.get(i).getDestination().equals("TYN")) {
								temp = "太原";
							} else if (beans.get(i).getDestination().equals("HFE")) {
								temp = "合肥";
							} else if (beans.get(i).getDestination().equals("CTU")) {
								temp = "成都";
							} else if (beans.get(i).getDestination().equals("HND")) {
								temp = "羽田";
							} else if (beans.get(i).getDestination().equals("HGH")) {
								temp = "杭州";
							} else if (beans.get(i).getDestination().equals("WUH")) {
								temp = "武漢";
							} else if (beans.get(i).getDestination().equals("GMP")) {
								temp = "金浦";
							} else if (beans.get(i).getDestination().equals("NNG")) {
								temp = "南寧";
							} else if (beans.get(i).getDestination().equals("SHA")) {
								temp = "虹橋";
							} else if (beans.get(i).getDestination().equals("CKG")) {
								temp = "重慶";
							} else if (beans.get(i).getDestination().equals("PVG")) {
								temp = "浦東";
							} else if (beans.get(i).getDestination().equals("HAK")) {
								temp = "海口";
							} else if (beans.get(i).getDestination().equals("XMN")) {
								temp = "廈門";
							} else if (beans.get(i).getDestination().equals("WNZ")) {
								temp = "溫州";
							} else if (beans.get(i).getDestination().equals("FOC")) {
								temp = "福州";
							} else {
								temp = beans.get(i).getDestination();
							}
						%>
							<%=temp %>
					</td>
					
					<td align="center" valign="middle">
					<%
						temp = beans.get(i).getSchedTime();
						temp = temp.substring(0, 2) + ":" + temp.substring(2);
					%>
						<%=temp %>
					</td>
					
				</tr>
				
				<%
					}
				}
				%>
				
			</tbody>
	  </table>
	</td>
	
	<!--arrival-->
    <td width="50%" valign="top">
		<table width="100%" height="100%" align="left" id="newspaper-a" summary="arrival">
		  <thead>
			<tr>
			  <th width="45" align="center" valign="middle" scope="col">次序</th>
			  <th width="117" align="center" valign="middle" scope="col">航空公司</th>
			  <th width="91" align="center" valign="middle" scope="col">編號</th>
			  <th width="95" align="center" valign="middle" scope="col">地點</th>
			  <th width="88" align="center" valign="middle" scope="col"><b><font color="009900">入境</font></b></th>
			</tr>
		  </thead>
		  <tbody>
		  
		  <%
			  beans = (ArrayList<FlightBean_Intl>) request.getAttribute("arrival");
			  temp = "";
			  counter = 0;
			%>
			<%
				if (beans.size()==0) {
			%>		
				</table><font color="#FF0000" size="+2">請稍等一下，為您重新讀取松山機場資料庫！</font>
				<script type="text/javascript" language="JavaScript">
			      			reload("yes");
			   			</script>
			<%
				} else {
			%>
			<%
			  for (int i=0; i<beans.size(); i++) {
				  counter++;
		  %>
		  
			  <tr>
					
				<td align="center" valign="middle"><%=counter %></td>
				
				<td align="center" valign="middle">
					<%
						if (beans.get(i).getAirline().equals("FM")) {
							temp = "上航";
						} else if (beans.get(i).getAirline().equals("NH")) {
							temp = "全日空";
						} else if (beans.get(i).getAirline().equals("CA")) {
							temp = "國航";
						} else if (beans.get(i).getAirline().equals("3U")) {
							temp = "川航";
						} else if (beans.get(i).getAirline().equals("MF")) {
							temp = "廈航";
						} else if (beans.get(i).getAirline().equals("GE")) {
							temp = "復興";
						} else if (beans.get(i).getAirline().equals("TW")) {
							temp = "德威";
						} else if (beans.get(i).getAirline().equals("JL")) {
							temp = "日航";
						} else if (beans.get(i).getAirline().equals("ESR")) {
							temp = "易斯達";
						} else if (beans.get(i).getAirline().equals("ZE")) {
							temp = "易斯達";
						} else if (beans.get(i).getAirline().equals("MU")) {
							temp = "東航";
						} else if (beans.get(i).getAirline().equals("AE")) {
							temp = "華信";
						} else if (beans.get(i).getAirline().equals("CI")) {
							temp = "華航";
						} else if (beans.get(i).getAirline().equals("FE")) {
							temp = "遠東";
						} else if (beans.get(i).getAirline().equals("BR")) {
							temp = "長榮";
						} else if (beans.get(i).getAirline().equals("B7")) {
							temp = "立榮";
						} else {
							temp = beans.get(i).getAirline();
						}
					%>
						<%=temp %>
				</td>
				
				<td align="center" valign="middle">
					<%
						temp = beans.get(i).getAirline() + "-" + beans.get(i).getFlightNo();
					%>
						<%=temp %>
				</td>
				
				<td align="center" valign="middle">
					<%
						if (beans.get(i).getOrigin().equals("TSN")) {
							temp = "天津";
						} else if (beans.get(i).getOrigin().equals("TYN")) {
							temp = "太原";
						} else if (beans.get(i).getOrigin().equals("HFE")) {
							temp = "合肥";
						} else if (beans.get(i).getOrigin().equals("CTU")) {
							temp = "成都";
						} else if (beans.get(i).getOrigin().equals("HND")) {
							temp = "羽田";
						} else if (beans.get(i).getOrigin().equals("HGH")) {
							temp = "杭州";
						} else if (beans.get(i).getOrigin().equals("WUH")) {
							temp = "武漢";
						} else if (beans.get(i).getOrigin().equals("GMP")) {
							temp = "金浦";
						} else if (beans.get(i).getOrigin().equals("NNG")) {
							temp = "南寧";
						} else if (beans.get(i).getOrigin().equals("SHA")) {
							temp = "虹橋";
						} else if (beans.get(i).getOrigin().equals("CKG")) {
							temp = "重慶";
						} else if (beans.get(i).getOrigin().equals("PVG")) {
							temp = "浦東";
						} else if (beans.get(i).getOrigin().equals("HAK")) {
							temp = "海口";
						} else if (beans.get(i).getOrigin().equals("XMN")) {
							temp = "廈門";
						} else if (beans.get(i).getOrigin().equals("WNZ")) {
							temp = "溫州";
						} else if (beans.get(i).getOrigin().equals("FOC")) {
							temp = "福州";
						} else {
							temp = beans.get(i).getOrigin();
						}
					%>
						<%=temp %>
				</td>
				
				<td align="center" valign="middle">
					<%
						temp = beans.get(i).getSchedTime();
						temp = temp.substring(0, 2) + ":" + temp.substring(2);
					%>
						<%=temp %>
				</td>
				
			</tr>
			
			<%
				}
				}
			%>
		  </tbody>
	  </table>
	</td>
  </tr>
</table>

<center><font size=2 face="Arial" color="#777777">航班資料由<a href="http://www.tsa.gov.tw">松山機場</a>提供</font></center>
</body>
</html>